package com.joker.service.impl;

import com.joker.dao.UserRepository;
import com.joker.pojo.User;
import com.joker.service.UserService;
import com.joker.util.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author JokerKS
 * @Date 2021/12/06 10:29
 * @Version 1.0
 */
@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserRepository userRepository;

	@Override
	public User checkUser(String username, String password) {
		User user = userRepository.findByUsernameAndPassword(username, MD5Utils.code(password));
		return user;
	}
}
